﻿var status = 0;

var time = java.util.Calendar.getInstance();
var year = time.get(java.util.Calendar.YEAR); //获得年份
var month = time.get(java.util.Calendar.MONTH) + 1; //获得月份
var day = time.get(java.util.Calendar.DATE); //获取日
var hour = time.get(java.util.Calendar.HOUR_OF_DAY); //获得小时
var minute = time.get(java.util.Calendar.MINUTE); //获得分钟
var second = time.get(java.util.Calendar.SECOND); //获得秒
var tz20 = "#fEffect/CharacterEff/1114000/1/0#"; //红星花
//var eff1 = "#fUI/StarCityUI.img/GradeInfo/icon_ss/7#"
var eff1 = "#fEffect/CharacterEff/1112949/3/0#"; //花样音符
//var eff1 = "#fUI/StarCityUI.img/GradeInfo/icon_ss/7#"
var z = "#fUI/UIWindow/Quest/icon5/1#"; //"+z+"//美化
var w = "#fEffect/CharacterEff/1051296/1/0#";
var p2 = "#fUI/SoulUI.img/DungeonMap/icon/dungeonItem/0#"
var tz12 = "#fEffect/CharacterEff/1112924/0/0#"; //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#"; //蓝星


function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001) {
        cm.sendOk("很遗憾，您因为违反用户守则被禁止游戏活动，如有异议请联系管理员.")
        cm.dispose();
    } else if (status == 0) {
        var selStr = "\t" + "欢迎来到" + cm.getServerName() + "游戏中心#k\r\n";
        selStr += "" + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + "\r\n";
        selStr += "#L3#" + p2 + "#rVIP会员#l";
        selStr += "#L8#" + p2 + "#r余额系统#l";
        selStr += "#L4#" + p2 + "#r兑换系统#l\r\n\r\n";
        selStr += "#L0#" + p2 + "#d高手进阶#l";
        selStr += "#L1#" + p2 + "#d星岩卡槽#l";
        selStr += "#L2#" + p2 + "#d怪怪图鉴#l\r\n\r\n";
        selStr += "#L5#" + p2 + "#r混战PK#l\r\n\r\n";
        // selStr += "#L6#" + p2 + "#r娱乐游戏#l\r\n\r\n";
        //selStr += "#L7#" + p2 + "#r最强BOSS#l\r\n\r\n";
        selStr += "" + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + tz20 + "" + tz12 + "" + tz13 + "\r\n";
        cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
            case 0: //高手进阶
                cm.dispose();
                cm.openNpc(0, "高手进阶");
                break;
            case 1: //星岩卡槽
                cm.dispose();
                cm.openNpc(0, "星岩卡槽");
                break;
            case 2: //怪怪图鉴
                cm.dispose();
                cm.openUI(0x254);
                break;
            case 3: //会员服务
                cm.sendOk("该功能关闭中");
                cm.dispose();
                // cm.openNpc(0, "VIP会员");	
                break;
            case 4: //银行中介
                cm.dispose();
                cm.openNpc(0, "兑换系统");
                break;
            case 5: //PK
                cm.dispose();
                cm.openNpc(0, "PK系统");
                break;
            case 6: //娱乐游戏
                cm.dispose();
                cm.openNpc(9310377);
                break;
            case 7: //最强BOSS
                cm.dispose();
                cm.openNpc(9900004, 106);
                break;
            case 8: //余额系统
                cm.sendOk("该功能关闭中");
                cm.dispose();
                // cm.openNpc(0, "余额系统");
                break;
        }
    }
}